﻿#include "Monster.h"

#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cassert>

#include "FiberMgr.h"

Monster::Monster(void)
:name_("")
,pos_(0)
,gotoandeat_tasklet_(NULL)
{
}

Monster::Monster(const std::string& name, int pos)
:name_(name)
,pos_(pos)
,gotoandeat_tasklet_(NULL)
{
}


Monster::~Monster(void)
{
	if(gotoandeat_tasklet_)
	{
		delete gotoandeat_tasklet_;
	}
}

void Monster::gotoAndEat(int tgt, int speed)
{
	if(gotoandeat_tasklet_)
	{
		delete gotoandeat_tasklet_;
	}
	gotoandeat_tasklet_ = new GotoTasklet(this, tgt, speed);
	assert(gotoandeat_tasklet_);
}
